home *** CD-ROM | disk | FTP | other *** search
- /*
- File: UTCUtils.h
-
- Contains: Interface for UTC to Local Time conversion and 64 Bit Clock routines
-
- Version: Sonata
-
- DRI: Julio Gonzalez
-
- Copyright: © 1999 by Apple Computer, Inc., all rights reserved.
-
- Warning: *** APPLE INTERNAL USE ONLY ***
- This file may contain unreleased API's
-
- BuildInfo: Built by: Scott Johnson
- On: 10/8/99 11:27 AM
- With Interfacer: 3.0d13 (MPW PowerPC)
- From: UTCUtils.i
- Revision: 3
- Dated: 4/14/99
- Last change by: jag
- Last comment: Rename some of the new APIs to be more consistent with old 32
-
- Bugs: Report bugs to Radar component "System Interfaces", "Latest"
- List the version information (from above) in the Problem Description.
-
- */
- #ifndef __UTCUTILS__
- #define __UTCUTILS__
-
- #ifndef __MACTYPES__
- #include <MacTypes.h>
- #endif
-
-
-
-
- #if PRAGMA_ONCE
- #pragma once
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT
- #pragma import on
- #endif
-
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=mac68k
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(push, 2)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack(2)
- #endif
-
- /* Status Codes */
- enum {
- kUTCUnderflowErr = -8850,
- kUTCOverflowErr = -8851,
- kIllegalClockValueErr = -8852
- };
-
-
-
- /* 64 Bit Clock Typedefs */
-
- struct UTCDateTime {
- UInt16 highSeconds;
- UInt32 lowSeconds;
- UInt16 fraction;
- };
- typedef struct UTCDateTime UTCDateTime;
- typedef UTCDateTime * UTCDateTimePtr;
- typedef UTCDateTimePtr * UTCDateTimeHandle;
-
- struct LocalDateTime {
- UInt16 highSeconds;
- UInt32 lowSeconds;
- UInt16 fraction;
- };
- typedef struct LocalDateTime LocalDateTime;
- typedef LocalDateTime * LocalDateTimePtr;
- typedef LocalDateTimePtr * LocalDateTimeHandle;
- /* Classic 32 bit clock conversion routines */
- EXTERN_API_C( OSStatus )
- ConvertLocalTimeToUTC (UInt32 localSeconds,
- UInt32 * utcSeconds);
-
- EXTERN_API_C( OSStatus )
- ConvertUTCToLocalTime (UInt32 utcSeconds,
- UInt32 * localSeconds);
-
- /* 64 bit clock conversion routines */
- EXTERN_API_C( OSStatus )
- ConvertUTCToLocalDateTime (const UTCDateTime * utcDateTime,
- LocalDateTime * localDateTime);
-
- EXTERN_API_C( OSStatus )
- ConvertLocalToUTCDateTime (const LocalDateTime * localDateTime,
- UTCDateTime * utcDateTime);
-
- /* Getter and Setter Clock routines using 64 Bit values */
- EXTERN_API_C( OSStatus )
- GetUTCDateTime (UTCDateTime * utcDateTime,
- Boolean needFraction);
-
- EXTERN_API_C( OSStatus )
- SetUTCDateTime (const UTCDateTime * utcDateTime);
-
- EXTERN_API_C( OSStatus )
- GetLocalDateTime (LocalDateTime * localDateTime,
- Boolean needFraction);
-
- EXTERN_API_C( OSStatus )
- SetLocalDateTime (const LocalDateTime * localDateTime);
-
-
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=reset
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(pop)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack()
- #endif
-
- #ifdef PRAGMA_IMPORT_OFF
- #pragma import off
- #elif PRAGMA_IMPORT
- #pragma import reset
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __UTCUTILS__ */
-
-